import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)

const store = new vuex.Store({//store对象
    //根据实际情况来操作组件的状态
    state: {
        showGoodsList: false
    },
    //管理多个state
    mutations: {
        setGoodsList(state,bool) {
            state.showGoodsList = bool
        }
    },
    //管理多个mutations
    actions: {
        toSetGoodsList(context,bool) {
            context.commit('setGoodsList',bool)
        }
    }
})

export default store